#!/usr/bin/env bash

tags_dir=~/.tags

if [ ! -d $tags_dir ]; then
    mkdir -p $tags_dir
fi

if [ "$1"x == "oc"x ] ; then
    tags_dir_sub=$tags_dir/oc
    mkdir -p $tags_dir_sub
    cd $tags_dir_sub
    find ~/git/oc -name "*.h" -o -name "*.c" -o -name "*.cpp" > cscope.files
    cscope -bkq -i cscope.files
    rm cscope.files
elif [ "$1"x == "wf"x ] ; then
    tags_dir_sub=$tags_dir/wf
    mkdir -p $tags_dir_sub
    cd $tags_dir_sub
    find ~/git/wf3000 -name "*.h" -o -name "*.c" -o -name "*.cpp" > cscope.files
    cscope -bkq -i cscope.files
    rm cscope.files
else
    echo $cmd
    #echo "ctags -R  --languages=c++ --langmap=c++:+.inl -h +.inl --c++-kinds=+p --fields=+aiKSz --extra=+qf --exclude=.svn --exclude=.git --exclude=*.bak --exclude=tmp --exclude=bak --exclude=build --exclude=build_cocoa_debug --exclude=r90  --exclude=hdocs --exclude=tarball"

fi
#echo "ctags -R  --languages=c++ --langmap=c++:+.inl -h +.inl --c++-kinds=+p --fields=+aiKSz --extra=+qf --exclude=.svn--exclude=.git --exclude=*.bak --exclude=tmp --exclude=tarball"
